<?php


namespace app\mini\controller;

// use app\BaseController as BaseController;
use app\mini\model\PersonCase as PersonCaseModel;
use think\response\Json;


class PersonCase extends Access
{
    /**
     * 案例列表
     * @return Json
     * @author hz
     * @create 2021-10-26
     */
    public function index(): Json
    {
        $this->param = request()->param();
        $personCaseModel = new PersonCaseModel();
        // $this->param['person_id'] = $this->customerId;// 员工端则为员工id
        $data = $personCaseModel->getCaseList($this->param);
        return resultArray($data);
    }

	/**
     * 案例详情
     * @return Json
     * @author hz
     * @create 2021-10-26
     */
    public function detail(): Json
    {
    	$this->param = request()->param();
        $personCaseModel = new PersonCaseModel();
        // $this->param['person_id'] = $this->customerId;// 员工端则为员工id
        $data = $personCaseModel->getDetail($this->param);
        return resultArray($data);
    }

    /**
     * 案例跟进列表
     * @return Json
     * @author hz
     * @create 2021-10-26
     */
    public function caseLog(): Json
    {
        $this->param = request()->param();
        $personCaseModel = new PersonCaseModel();
        // $this->param['person_id'] = $this->customerId;// 员工端则为员工id
        $data = $personCaseModel->getLogList($this->param);
        return resultArray($data);
    }

    /**
     * 添加案例跟进
     * @return Json
     * @author hz
     * @create 2021-10-26
     */
    public function addCaseLog(): Json
    {
        $this->param = request()->param();
        $personCaseModel = new PersonCaseModel();
        // $this->param['person_id'] = $this->customerId;// 员工端则为员工id
        $data = $personCaseModel->addCaseLog($this->param);
        return resultArray($data);
    }
}